package com.example.s05_shop.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "orders")
public class Orders {

    @TableId(value = "id",type = IdType.AUTO)
    int id;
    @TableField(value = "user_id")
    int userId;
    @TableField(value = "total_price")
    BigDecimal totalPrice = new BigDecimal("0.00");
    @TableField(value = "gmt_create")
    Date gmtCreate;

    @TableField
    String name;
    @TableField
    String tel;
    @TableField
    String address;

    @TableField
    String status;

    @TableField(exist = false)
    List<OrdersItem> itemList;
}